function Bullet(image, x, y, speed, angle) {
  this.image = image;
  this.x = x;
  this.y = y;
  this.speed = speed;
  this.angle = angle;
  this.life = 0;
  this.lifetime = 1;
}

Bullet.prototype.update = function(dt) {
  this.life += dt;
  if (this.life > this.lifetime) {
    return 0;
  }
  this.x += this.speed * Math.cos(this.angle) * dt;
  this.y += this.speed * Math.sin(this.angle) * dt;
  return 1;
}

Bullet.prototype.render = function(context) {
  context.save();
  context.translate(this.x, this.y);
  context.rotate(this.angle);

  context.beginPath();
  context.moveTo(0, 0);  
  context.strokeStyle = 'rgb(255, 255, 100)';
  context.lineWidth = 2;
  context.lineCap = 'square';
  context.lineTo(20, 0);
  context.stroke();
  //context.drawImage(this.image, 0, 0);
  context.restore();
}
